//
// Created by 51399 on 2021/5/27.
//

#ifndef C__SOCKET_H
#define C__SOCKET_H

#include "stdio.h"
#include "stdlib.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include "arpa/inet.h"
#include "unistd.h"
#include "string.h"

#define N 128

void _bind(char *port, char *ip);

typedef union {
    int a;
    char b;
} te;

void _socket_UDP();

void _test_();

int create_socket(int sockType);

void recvBuff(int fd);

void *create_sockaddrIn(char *port, char *ip);
void _broadcast(char *ip, char *port);
void _TCP_client(char *ip, char *port);
void write_socket(int fd, struct sockaddr_in *serveraddr);
void _TCP_server(char *ip, char *port);
#endif //C__SOCKET_H
